package com.atguigu.classroom.activity.controller;

import com.atguigu.classroom.activity.service.CouponUseService;
import com.atguigu.classroom.model.activity.CouponUse;
import com.atguigu.classroom.result.Result;
import com.atguigu.classroom.vo.activity.CouponUseQueryVo;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "新优惠卷接口")
@RestController
@RequestMapping("/admin/activity/couponUse/")
public class CouponUseController {
    @Autowired
    private CouponUseService couponUseService;
    @ApiOperation(value = "获取已被使用的优惠卷分页列表")
    @GetMapping("couponUse/{page}/{limit}")
    public Result index(@PathVariable Long page,
                        @PathVariable Long limit,
                        CouponUseQueryVo couponUseQueryVo) {
        Page<CouponUse> couponUsePage=couponUseService.getPage(page,limit,couponUseQueryVo);
        return Result.ok(couponUsePage);
    }
}

